Copyright: Copyright (c) 1996 Teknowledge Corp.


Table of Contents
Welcome to the M.4 version 3.01 demonstration disk.

This disk will let you see some of the power and simplicity of M.4 by hands-on usage.  It will let you run the knowledge bases we provide and it will let you examine and change knowledge bases to see how they work.  However, it will not let you save your changes or explore some of the integration features of the product.

Contents

Introduction

M.4: The Embeddable Expert System Solution

Technical Description

Sample Systems

The Delivery/Demo Environment

Obtaining Further Information About M.4

Ordering M.4

Copyright

Copyright (c) 1996 Teknowledge Corporation.

All Rights Reserved.


Introduction
Introduction to M.4

M.4 is a powerful software tool used to build knowledge systems and embed intelligent processing into software applications. A knowledge system (also known as an expert system) uses human knowledge and experience to solve problems, increase productivity, and help novice users make expert decisions. The purpose of a knowledge system is to perform the task of solving problems by capturing the reasoning process of the expert in software.M.4 has been used to build selection, analysis, scheduling, configuration, diagnosis, planning and design applications, in the fields of manufacturing, finance, administration, field service, data processing, management information systems, sales, marketing, training and education.

A knowledge system is built from facts, rules, procedures, and objects that relate to a specific problem. During operation the inference engine performs the reasoning process of the human and assists in solving a problem by drawing conclusions based on perceived facts. This is achieved by using information stored as a knowledge base and comparing it with input from the external environment. In this way a large number of possible conclusions are narrowed to select the appropriate solution.


M.4: The Embeddable Expert System
M.4: The Embeddable Expert System Solution

Finally there's a fast, easy way to add intelligence to your software.

M.4 is a powerful software tool for building knowledge systems and embedding intelligent processing in your software programs. M.4 can be used to develop a variety of applications (e.g., selection, analysis, scheduling, configuration, diagnosis, planning, and design applications) in many diverse areas such as manufacturing, finance and administration, field service, data processing and management information systems, sales and marketing, and training.

Related Topics

Embeddability

Flexibility

Knowledge Representation

Proven Track Record

Support

System Requirements


Embeddability

The ability to embed intelligence is the key to successful software applications in today's complex, interconnected environments. Applications are asked to make sense of information from networks, databases, spreadsheets, and even neural networks. This information needs to be made available to increasingly more novice end-users with less and less time for training. Embedding an experts knowledge into programs to be used by novice end-users is no longer a novelty, but is becoming a necessity.

An integral part of M.4's design is the Kernel Library, a subroutine package offered by no other major expert systems tool. In a matter of minutes, you can completely remove M.4's user interface and link the Kernel Library into your C language applications under both DOS and Windows. From there only a few simple function calls are needed to access expertise as part of the solution your application provides.

Since the M.4 Kernel Library is highly modular, you can selectively enable, remove, or modify almost every part of M.4. Individual commands, built-in functions, and message handlers can be modified. You can even customize the M.4 language with your own knowledge base entry types and built-in functions.


Flexibility

M.4's architecture diagram illustrates M.4's architecture. The M.4 Interface Kernel is a proprietary kernel library which can be linked with your application. This callable library has over 110 routines that can be invoked to perform functions from initialization of a session with M.4 to dynamic modification of the knowledge base itself. The M.4 Kernel library can be used in the following ways:

•	DLL - (Dynamic Link Library)     can be created and linked with an executable

•	VBX - (Visual Basic Custom Control)     can be created and linked with an executable

•	EXE - (Executable)  The Kernel Library itself can be linked with an executable

Several applications that embed the M.4 Interface Kernel are included with the M.4 software. A DDE server is included to support communication with applications supporting the DDE protocol under Windows. Interfaces created using Asymetrix ToolBook, Microsoft Visual Basic, and Microsoft Visual C++ are included to facilitate development, debugging, and delivery of knowledge systems . The ToolBook interface is supported using the DDE server, the Visual Basic interface is supported by either the DDE server or the M.4 custom control (a VBX ), and the Microsoft Visual C++ interface is supported by the M.4 custom control . In DOS both a TTY interface and a "windowed" interface are include.

All sources for the applications that are included with M.4 are provided as working examples of what can be done by any C programmer with the M.4 Kernel.


Knowledge Representation

M.4's complete expert system language includes backward and forward chaining, pattern matching variables, back-tracking, recursion, iteration, facts and rules , certainty factors, symbolic list processing, value checking, and explanation.

Extended capabilities include meta-facts, meta-propositions, procedural control methods, and retraction. Powerful object-oriented features like classes, instances, slots and methods with inheritance and message passing round out M.4' s knowledge representation.


Track Record
Proven Track Record

A Solid History

The M.4 product line began with M.1 in 1984. Since then, it has been used to develop and field over 7500 expert system applications.  A few of our customers are:

Commercial and Industrial

ARCO, AT&T, Applied Materials, Ball, Bell Helicopter, Bell Northern, Federal Express, FMC, Ford, Kaiser Foundation, Kodak, General Dynamics, General Motors, Hughes, MONY, Motorola, National Patient Analytical System, NCR, Nynex, Phillips Petroleum, Proctor & Gamble, Rockwell, Timken, Travelers Insurance, Upjohn.

Government and Schools

U.S. Army, Navy and Air Force, National Archives, U.S. Fish and Wildlife Service, Oak Ridge National Laboratory, Stanford University, Texas Tech University, University of British Columbia, University of Florida, University of Utah.


Support

Teknowledge has been a leading expert system product and services company for over twelve years. With over 300 person-years of experience building expert systems, our highly capable staff is ready to assist with all aspects of development and fielding.

We offer several levels of support, including:

•	Telephone product support, free for the first 90 days

•	Integration and programming assistance

•	Knowledge system development assistance

•	Complete feasibility, design, and development services.

Please contact us for more details

Phone:	800/285-0500 or 415/424-0500

FAX:	415/493-2645

Email:	m4@teknowledge.com

WWW: http://www.teknowledge.com/M4

Mail:	Teknowledge Corporation
1810 Embarcadero Road
Palo Alto, CA USA
94303


System Requirements

M.4 is written in C to be small and fast, and to facilitate integration with conventional software packages. M.4 runs on IBM PCs (PC/XT/AT/386/486/Pentium) and fully compatible microcomputers (IBM is a registered trademark of International Business Machines Corporation). Under DOS, M.4 requires a minimum of 512K RAM and DOS Version 3.0 or higher. Under Microsoft Windows 3.1 M.4 requires a minimum of 4MB RAM. A full installation of M.4 requires 9 MB of hard disk space..


Information
Obtaining Further Information About M.4

M.4 comes in a low-cost VBX form (M.4 VB) and also comes in a full version that allows extensive customization and integration.  A few of the features of the full version are:

•	Visual Basic, Visual C/C++, Asymetrix Toolbook, DOS panels, and DOS TTY interfaces

•	A DDE server

•	Full API for deeply embedding M.4 into your C applications

•	Libraries and makefiles for rebuilding the custom control and for the DDE server

•	A 500 page printed manual

Additional copies of the printed reference manual are available, as are copies of the Embedders Reference Guide which documents the 110+ API calls available in the full M.4 product.

Both corporate and educational site licenses are available.

If you have any questions about the M.4 product line, please contact us at:

Phone:	800/285-0500 or 415/424-0500

FAX:	415/493-2645

Email:	m4@teknowledge.com

WWW: http://www.teknowledge.com/M4

Mail:	Teknowledge Corporation
1810 Embarcadero Road
Palo Alto, CA
94303
USA

Copyright


Copyright
Copyright Notice

Copyright (c) 1996 Teknowledge Corporation. All Rights Reserved.

This software is covered by U.S. Patents 4,648,044, 4,783,752 and 4,803,641.

Version 3.01.005

Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software Clause at DFARS 252.227-7013.

Teknowledge Corporation
1810 Embarcadero Road
Palo Alto, CA 94303
USA
(415) 424-0500

Microsoft and MS-DOS are registered trademarks, and Windows, Visual Basic Visual C++ are trademarks of Miscrosoft Corporation in the USA and other countries.

Asymetrix, ToolBook, and OpenScript are registered trademarks of Asymetrix Corporation.


Orderint
Ordering M.4

Click here for ordering instructions...


Technical Description
M.4 Technical Description

M.4 is a robust, full-featured, PC-based tool for developing both standalone and embedded knowledge systems. It offers a rich language for representing domain knowledge with a combination of rules, facts, procedures, and objects, a development environment that makes it easy to build and debug knowledge bases, and the capability to custom tailor a delivery system to meet users' needs.

Related Topics:

Architecture

Language

Developing Knowledge Systems


Architecture

The diagram illustrates M.4's architecture. The M.4 Inference Kernel is a proprietary kernel library which can be linked with your applications. This callable library has over 110 routines that can be invoked to perform functions from initialization of a session with M.4 to dynamic modification of the knowledge base itself. The M.4 Kernel library can be used in the following ways:

•	DLL - (Dynamic Link Library) can be created and linked with an executable

•	VBX - (Visual Basic Custom Control) can be created and linked with an executable

•	EXE - The Kernel library itself can be linked with an executable

Several applications that embed the M.4 Inference Kernel are included with the M.4 software. A DDE server is included to support communication with applications supporting the DDE protocol under Windows. Development and delivery interfaces created using Asymetrix ToolBook and Microsoft Visual Basic are included to facilitate development and debugging of knowledge systems. The ToolBook interface is supported using the DDE server and the Visual Basic interface is supported by either the DDE server or the M.4 custom control (a VBX). A delivery interface for Microsoft Visual C++ supported by the M.4 custom control has also been provided. In DOS both a TTY interface and a "windowed" interface are included. The following table shows what interfaces are provided, how each is supported and the type of interface (User - Delivery of applications to users, DEV - Development of applications, DEV/User - both Development and Delivery combined). The TBOOK.EXE executable is used to run a ToolBook book called M4DEV.TBK which starts the M.4 Server and communicates with the server through DDE. Knowledge bases developed in any development environment can be delivered with any delivery interface.

Interface	Supported By	Type of Interface
Visual Basic	VBX	Dev/User
Visual Basic Client	DDE	User
Visual C++	VBX	User
ToolBook	DDE Server	Dev/User
DOS Windows for C	M.4 Library	Dev/User
DOS TTY	M.4 Library	Dev/User
All source code for these interfaces and servers is available in specific directories, including makefiles, ToolBook scripts, and custom control interface code. This provided code can be used as a starting place for your own applications. Details on building knowledge bases and interfacing the M.4 Kernel with your applications are available in the M.4 User's Guide and the Embedder's Reference Guide. The User's Guide is included with the M.4 software and the Embedder's Reference Guide is available for an additional $20 plus shipping and handling.


M.4 Language

The M.4 language can be learned and put to effective use in a relatively short time, even by individuals with little conventional programming experience or no previous exposure to knowledge system technology. At the same time, M.4 is powerful enough to support the development of complex, commercial quality knowledge systems of significant value. M.4 provides a powerful, rule-based programming language integrated with both procedural and object oriented language support. The versatility of M.4's language makes it possible to easily create applications that involve complex control and object oriented knowledge representation. In addition the M.4 language can be extended to add custom access routines for maximum flexibility.

M.4 is written in C to be small and fast, and to facilitate integration with conventional software packages. M.4 runs on IBM PCs (PC/XT/AT/386/486/Pentium) and fully compatible microcomputers (IBM is a registered trademark of International Business Machines Corporation). Under DOS M.4 requires a minimum of 512K RAM and DOS Version 3.0 or higher. Under Microsoft Windows 3.1 M.4 requires a minimum of 4MB RAM. A hard disk drive of 30MB or more is recommended for both the DOS and Windows environments.

Key features include:

Language Features:

•	Backward chaining via rules

•	Certainty factors

•	Forward chaining via whenfound/whencached and procedures

•	Facts

•	Procedures

•	Pattern matching variables

•	Ability to reset expressions

•	Back tracking, recursion, and iteration

•	Symbolic list processing

•	Objects with classes, instances, inheritance, and message passing

•	String manipulation

•	Command language

Embeddability and Integration Features:

•	Kernel library with 110 accessible routines

•	DDE Server

•	Visual Basic custom control

•	M.4 DLL

•	External "C" code hook

•	Language extensibility

•	API with 14 channels

•	Built-in hook to ODBC and to dBase III

•	Logging to files

User-Interface and Delivery Features:

•	Choice of configurable interfaces

•	Legal value checking

•	Multivalued expressions

•	Explanation facility

•	Customizable pull-down menus

•	Menus or enumerated answers

•	Knowledge base encryption

•	Unknown permitted as an answer(optional)

•	Overlays to permit large knowledge bases

•	Fast load KB facility

•	ToolBook interface

•	Visual Basic interface

•	Visual C++ Interface

Development Environment Features:

•	ASCII file KB format

•	Color display

•	Multi-window debugging

•	Log facility

•	Automatic query generation

•	Single step mode

•	Trace facility

•	Show cache (conclusions)

•	Selectable Editor

•	Delivery test mode


Developing Knowledge Systems with M.4

Knowledge systems built with M.4 are designed around a knowledge base containing rules, facts, procedures, and objects relating to a particular task or application, and an inference engine that enables the system to reason about the domain (i.e., derive new facts) in order to solve specific problems. The process of building a knowledge base entails the collection, organization, and representation of knowledge (elicited from an expert in the case of an expert system) using rules, facts, procedures, and objects.

In addition, the development of a knowledge system often entails customizing the user-interface or integrating with a database, graphics package, or other utility.

Related Topics:

The Knowledge Base and Inference Mechanism

User-Interface and Delivery Systems

Development Environment


The Knowledge Base and Inference Mechanism

An M.4 knowledge base contains rules, facts, procedures, and objects that represent the knowledge for a specific domain. The M.4 inference engine operates on this knowledge to reason about and solve the problem at hand. Below are some features of the knowledge representation capabilities and inference engine provided by M.4:

Related Topics:

Knowledge Base Contents

Seeking the Value of an Expression

Pattern-Matching Variables

Procedures

Control of Inference

Object-Oriented Programming

Certainty Factors

Ability to Reset the Values of Expressions

Symbolic List Processing

Database Integration

External Code Hook

Language Extensibility

Knowledge Base Size


Knowledge Base Contents

Symbolic expressions take on values (e.g., size of drill bit, recommended_price, or age(mary)), can be tested in rules, tested or manipulated in procedures, or given static values via facts. When the value of a symbolic expression is needed, M.4's inference engine, guided by the knowledge base, may obtain the value from a fact, by using rules, by asking the user, and/or by calling an external routine.

Facts are used in an M.4 knowledge base to represent information that is known statically about the domain (e.g., age of 'John Q. Public' = 47 or wine(red, full, dry) = zinfandel). Facts may also be stored in cache files that can be loaded on demand; these cache files (one could represent a tax table, for example) can be easily maintained or can be produced and passed to M.4 by other software.

Rules are used to derive new facts based on specified conditions. The premise of a rule specifies the conditions under which a new fact can be concluded. Symbolic as well as numeric comparisons or tests can be combined with standard Boolean operators to form the rule premise. Also, basic arithmetic functions are available for use in the premise of a rule.


Seeking the Value of an Expression

When a rule is used in an attempt to find a value for an expression, back-chaining can be triggered, causing M.4 to seek values for expressions tested in the rule's premise. For example, if M.4 is trying to find the value of recommended_wine by using the rule

if best color for wine = red and

   best body for wine = full

then recommended wine = zinfandel.

M.4 may try rules that conclude best_color_for_wine in an attempt to determine if best_color_for_wine is red.

M.4 may ask the user for the value of an expression it seeks if it encounters a question meta-fact for the expression in the knowledge base. Additional meta-facts for the expression can specify the legal values for the expression and whether or not a single value or multiple values are allowed for the expression. Legal values that are listed can be presented to the user in a menu or as an enumerated list following the question. Expressions can be declared to be "integer" or "number" (real). In addition a range can be specified for integers or numbers. Expressions can also be used symbolically as described in the preceding discussion of symbolic expressions.


Pattern-Matching Variables

Pattern-matching variables can be employed in rules and facts to make them more general and powerful, combining into a single fact that which would otherwise require a number of rules or facts. For example, since the body of zinfandel wines can be light, medium, or full, the fact wine(red, ANY_BODY, dry) = zinfandel may be used instead of the three facts wine(red, light, dry) = zinfandel, wine(red, medium, dry) = zinfandel, and wine(red, full, dry) = zinfandel. The following is an example of a rule that utilizes variables:

if recommended type = bolt and

   recommended length = LENGTH and

   recommended diameter = DIAMETER and

   recommended thread_pitch = PITCH and

   fastener(bolt, LENGTH, DIAMETER, PITCH) = BOLT

then recommended fastener = BOLT.


Procedures

Procedures in M.4 give the knowledge engineer a straightforward and compact means of specifying complex control. Utilizing a C-like syntax, one can direct the flow of control, evaluate expressions and initiate backchaining, iterate, display text, call other procedures, and execute M.4 commands. The following is an example of a procedure:

procedure(determine_and_display_recs(FAULT)) = {

    find recommendations(FAULT);

    LIST := listof(recommendations(FAULT));

    COUNT := 1;

    while (LIST == [ITEM | REST]) {

       display([COUNT, ". ", ITEM, nl]);

       COUNT := COUNT + 1;

       LIST := REST;

    };

}.


Control of Inference

Iteration, backtracking, and recursion are supported in M.4 in rules and, in the case of iteration and recursion, in procedures. M.4 uses a primarily back chaining rule structure. We have found through experience that this method in concert with the whenfound and whencached constructs discussed in the following section is sufficient to provide a solution to almost all knowledge system problems.

More than one goal can be specified for the back chaining search. The initial search will be performed to satisfy the first goal and then each subsequent goal will be satisfied in order. This gives knowledge engineers maximum flexibility in developing search strategies.

Forward chaining is also supported in M.4 with the whenfound and whencached constructs which cause actions to be taken after values for an expression have been sought. The action taken can be conditional, and may involve the invocation of a procedure or the initiation of backchaining. For example, something like the following whencached might be used to detect airplanes based on sensor data:

whencached(sensor_reading(SENSOR, TIME) = SIGNATURE) =

    ((signature_type(SIGNATURE) = jet or

      signature_type(SIGNATURE) = prop) and

      TIME - 1 = PEVIOUS and

      cached(sensor_reading(OTHER, PREVIOUS) = SIGNATURE) and

      neighbor(SENSOR) = OTHER and

      location(SENSOR) = LOC and

      do(set plane_detected(LOC, TIME))).

The above whencached asserts that a plane has been detected at location LOC at time TIME whenever a sensor reading at time TIME exhibits the signature of a jet or prop and can be associated with a similar sensor reading by some neighboring sensor during the previous time period.


Object-Oriented Programming

Object oriented programming is available in M.4 The following object oriented functionality is supported:

•	the definition of classes of objects and the creation of instances,

•	inheritance of slots, values, and methods,

•	overriding of inheritance for slots, values and methods, and

•	message passing to objects.

This object system which is based primarily on the CLOS standard provides a robust and powerful object oriented environment that facilitates the development of knowledge systems organized around objects.


Certainty Factors

Certainty factors make it possible to represent uncertain knowledge in M.4. For example, the following rule makes operational the heuristic that if it is summer in California it is very likely, but not definite, that it is sunny:

if location = california and

   season = summer

then weather = sunny cf 98.

Certainty factors can also be entered with user-input or from external files or databases. M.4's inference engine automatically deals with certainty factors, combining the certainty of input data, rule premise clauses, and rule conclusions, as well as accumulating the certainty of the same conclusion made by different rules. There are also built-in meta-propositions to test the certainty of expressions (e.g., EXPRESSION is definite, EXPRESSION is known, and EXPRESSION is unique). The use of certainty factors allows M.4 knowledge systems to reach realistic conclusions, even when faced with incomplete, uncertain, or even conflicting data or knowledge.


Ability to Reset the Values of Expressions

The ability to reset expressions is supported by M.4. This enables one to retract values that have been concluded for expressions, greatly facilitating combinatorial searches. This feature can also be used to allow users to change answers; although a built-in truth maintenance facility is not provided, the knowledge engineer can design the knowledge base to know about dependencies between expressions and retract conclusions affected by the user's change.


Symbolic List Processing

Symbolic list processing is supported by M.4. Lists can be created, sized, and manipulated. In addition, one can test to see if an item is contained in a list, or obtain its position in the list. Iteration over members of a list is also supported.


Database Integration

M.4's Open Database Connectivity (ODBC) interface allows applications to access data in database management systems (DBMS) using structured query language (SQL).as a standard for accessing data.

The ODBC interface permits maximum interoperabilitya single application can access different database management systems.  This allows an application developer to develop and ship an application without targeting a specific DBMS.  Users can then add modules called database drivers that link the application to their choice of database management system.

dBase III integration is provided for DOS developers.  M.4's dBase III integration capabilities allow the knowledge engineer to access data in dBase III databases, change values for database fields, and insert or delete records. Once database references are established, database accesses are transparent to the knowledge engineer (i.e., it is as if the database records were M.4 facts). Comparison operators allow one to limit access to subsets of database records.


Externel Code Hook
External Code Hook

An external code hook is provided in M.4 to enable knowledge system developers to integrate with functions written in the "C" programming language. This makes it possible to do such things as

•	integrate with a graphics package so that graphical help screens can be displayed to users,

•	interact with the PC's operating system to obtain the time and date or manipulate files,

•	utilize code libraries for math functions (e.g., sine, cosine, exponential, log, and square root),

•	integrate with other hardware (e.g., Programmable Logic Controllers or video disk units)

•	integrate with other software (e.g., statistical packages, signal analysis routines or neural networks).


Language Extensibility

Language extensibility in M.4 provides the developer with the ability to augment M.4's capabilities by adding custom commands, meta-propositions, and meta-facts to the M.4 language. These customizations can be written to perform all of the functions that external code hooks can perform, but they have the added advantage of being integrated directly with the M.4 knowledge base language. This makes it possible to intelligently control and interpret information. Applications such as intelligent databases, spreadsheets, and neural networks can be developed in this manner.


Knowledge Base Size

There are no explicit limits as to the size of knowledge bases in M.4, although the amount of memory (RAM and disk) available may impose limitations. M.4 can handle knowledge bases of roughly 2,000 rules and facts, depending on their size and complexity, on computer systems with 640K memory. When memory is limited or the knowledge base is larger, the knowledge base can be segmented and individual segments can be loaded dynamically as needed. If more memory is available the number of rules and facts that can be supported increases (systems with greater than 15,000 rules have been created).


User Interface and Delivery System
User-Interface and Delivery Systems

M.4 makes it easy for a developer to build either standalone end-user knowledge systems or applications with embedded knowledge processing. Standalone systems use either default or configured interfaces to display information that is generated by a loaded knowledge base. Normally these standalone systems communicate with the end-user by asking questions during a consultation. Applications with M.4 embedded typically utilize custom interfaces created by the developer. In addition the inferencing process is normally invisible to the end-user. The end-user usually sees an interface with text entry boxes, file selection menus, or buttons.

The following are some of M.4's features that support delivery systems:

•	M.4 provides a choice of user-interfaces for delivery: a simple, single-window user-interface, a configurable, multiple-window user-interface, a ToolBook Delivery interface, a Visual Basic Delivery interface, and a Visual C++ interface.

•	User-interfaces provide customizable pull-down menus for commands.  Commands may also be tied to function keys or CTRL/ALT characters. Pop-up confirmation or prompt boxes can also be configured and assigned to commands as needed.

•	The knowledge engineer can impose restrictions on answers to questions posed to users by the knowledge system. This includes specifying whether a question is single-valued or multi-valued (i.e., whether or not the answer should be limited to a single definite answer), and specifying legal values or ranges for answers. In addition, unknown and/or certainty factors can be disallowed for input.

•	Explanations are automatically generated by M.4 to explain why a particular question is being asked. The explanation is based on the rule or procedure that caused the question to be asked. Explanation generation may be overridden, however, by an enhanced or customized explanation if so desired by the knowledge engineer.

•	A delivery format for knowledge bases is provided for fast loading and is encoded for protection. For additional protection against unauthorized viewing or changing of the knowledge base, M.4 development commands may be disabled in a delivery system.

•	For large applications or where memory is limited, M.4 provides a knowledge base overlay capability, whereby a knowledge base can be divided into small segments that are dynamically loaded as needed.


Development Environment

M.4 also makes it easy to develop and maintain knowledge bases. M.4 knowledge bases can be made very easy to read, as the English-like rule language can be enhanced with user-defined prefix, infix, and postfix operators. Furthermore, through use of rules with variables, knowledge can often be expressed in a declarative form as M.4 facts. Below are some additional features of M.4 that support knowledge base development:

•	To make editing knowledge bases easy, M.4 knowledge bases are stored as ASCII files. This enables developers to work with their choice of text editor, organize and comment the knowledge base as they see fit, and easily obtain hardcopy for review off-line.

•	Also provides a variety of commands to view knowledge base and cache entries.

•	To facilitate debugging, M.4 provides a multi-window Inference Monitor debugging facility that displays relevant goals, knowledge base entries, and conclusions as a consultation is run. While debugging, consultations can be single stepped so that each action taken by M.4 can be viewed.

•	As an alternative, a trace facility is provided to display basic events as a consultation is run. This can be used in conjunction with M.4's logging facility to record information in a file for later review. The exact sequence of goals sought, rules invoked, facts or procedures used, instances created, and conclusions made by M.4 during a consultation can be traced.


M.4 Architecture


Sample Systems

This demonstration disk includes several sample knowledge bases to illustrate M.4 and its use.  For compactness in the descriptions, we will use the M.4 DOS command-line style to talk about what you type and what you see.

The Wine Advisor

Preface to The Wine Advisor

Run the Wine Advisor

The Vine Advisor

Preface to The Vine Advisor

Run the Vine Advisor

The Air Cargo Expert (ACE)

Preface to ACE

Run ACE

The Banking Sample System

Preface to Banker

Run Banker


Preface to The Wine Advisor

Introduction

What You Will See

Description of The Wine Knowledge Base

The Wine Advisor:  A Sample Consultation

Modifying The Knowledge Base


WINE ADVISOR Introduction
Introduction

This section describes The Wine Advisor, a small knowledge-based system designed to illustrate some of the workings of M.4, a knowledge engineering tool.  The Wine Advisor is an example of a "knowledge-based consultation system".  The system asks questions about a proposed meal and then recommends possible wines to go with that meal.  Although its recommendations are generally reasonable, the system is not illustrative of the full power of knowledge-based consultation.  The knowledge encoded in the system has been deliberately simplified to make it possible for those unfamiliar with knowledge engineering to understand M.4's operation in an hour or two.

The Wine Advisor has approximately forty-five Rules which are divided into two categories.  Half of the Rules describe particular wines with attributes such as color and sweetness.  The other half deduce the best combination of these attributes for a particular meal with attributes such as main-component, sauce, and tastiness.

Two typical Rules are shown below.

•	RuleGlossRule.244-33:

if recommended-color = red and

   recommended-body = medium and

   (recommended-sweetness = medium or

   recommended-sweetness = sweet)

then wine = gamay.

•	Rule-9:

if not(main-component = fish) and

   has-sauce = yes and

   sauce = tomato

then best-color = red.


What You Will See

By exploring the Wine Advisor, you can see that:

•	M.4 knowledge systems conduct consultations, ask questions, and give advice,

•	M.4 can explain why it is asking you questions,

•	The M.4 knowledge base patcher allows you to add questions and Rules to the knowledge base to change the behavior of the system, and

•	Trace and probe facilities allow you to inspect the reasoning process and help you debug the system.\


Description of The Wine Knowledge Base

Schematically, the knowledge base has the following form:

...click here for Figure

Capitalized words, such as TASTINESS, are expressions.  Phrases in lower case, such as wine Rules, are sets of Rules which use the expressions below them to infer a value for those above.  This diagram is a simplification; there are in fact nearly two dozen expressions.

Excerpts of the Wine knowledge base are listed below to introduce you to some M.4 terminology.

Related Topics:

Goal

Question

Legalvals

Rules

Certainty Factors

Using Trace


Goal

The goal of the Wine Advisor is to find the wine that best suits the meal and the user's preferences.  The goal is a fact which is written:

goal = wine.


Question

In order for the Wine Advisor to find out about the meal and the user's preferences, it must ask a question.  The knowledge engineer can specify how questions will be asked by writing the text for the question thus:

question(preferred-body) = 'Do you generally prefer light, medium, or full bodied wines?'.


Legalvals

The knowledge engineer specifies the acceptable answers to the question by using legalvals which is read as 'legal values'.

legalvals(preferred-body) = [light,medium,full].


Wine Knowledge Base - Rules
Rules

The reasoning in the Wine Advisor is represented in the form of Rules.  For example:

Rule-9:

if not(main-component = fish) and

   has-sauce = yes and

   sauce = tomato

then best-color = red.


Certainty Factors

One way that the knowledge engineer can work with uncertain information is by using certainty factors.  The range of certainty is between -100 and 100 where 100 means definite, -100 means definitely not, and anything between -20 and 20 is ignored.  In general certainty factors can be interpreted thus:

100 - definitely yes

 80 - almost certain

 60 - probably

 30 - slight evidence

 20 - smallest evidence worth considering

  0 - no evidence for or against -100 - definitely not


Using Trace

M.4 provides a simple, but powerful mechanism for tracing the inference path.  Tracing is useful for finding subtle faults in knowledge bases.  You can start and stop tracing at the question prompt >> and at the M.4 prompt M.4>.  Run a consultation using the commands below to see how the Wine Advisor uses Rules and attributes.

To start tracing type:

M.4>trace on

To stop tracing type:

M.4>trace off

To trace a particular expression, for example, the expression sauce, type:

M.4>trace sauce


The Wine Advisor:  A Sample Consultation

To get a full understanding of the Wine Advisor, it is best to start by conducting a few sample consultations.  In the following consultation, the Wine Advisor selects a wine to go with a turkey dinner.

When you see the M.4 prompt, M.4>, type go :

M.4>go

After a moment you will see:

Is the main component of the meal meat, fish, or poultry?

>>

Notice the double chevron prompt ">>", it indicates that you are in a consultation with an M.4 knowledge system.  Selecting a wine is based on the meal that the wine will accompany.  This simple wine advisor concerns itself with the main course of the meal, or the main component.  Answer that the main component for this meal is poultry, by typing poultry at the prompt.

>>poultry

You are probably familiar with the Rule of thumb that red wine goes with red meats, white wine with poultry and fish.  Turkey is an exception; some red wines accompany turkey very well.

M.4 has an answer completion facility.  You need only to type in enough letters to make your answer unambiguous before pressing <Enter>.

Does the meal have turkey in it?

>>y

The presence of a sauce is very important in selecting a wine.

Does the meal have a sauce on it?

>>y

For our turkey dinner, we will have a cranberry-orange sauce.

Is the sauce for the meal spicy, sweet, cream, or tomato?

>>sweet

The body of the wine should balance the strength of the flavor of the meal.  Turkey is not delicate, but is it not an overpowering meal either.

Is the flavor of the meal delicate, average, or strong?

>>average

The Wine Advisor now has all the information it needs.  There may be a bit of a wait here while the Wine Advisor "thinks".  In a few moments it will display its recommendations.  They are printed out in order of preference indicated by the certainty factor.

wine = riesling (85%) because Rule-38.

wine = gamay (76%) because Rule-33.

wine = chardonnay (58%) because Rule-36.

wine = chenin-blanc (51%) because Rule-40.

wine = cabernet-sauvignon(40%)because Rule-42.

wine = zinfandel (40%) because Rule-42.

wine = pinot-noir (40%) because Rule-43.

wine = soave (30%) because Rule-37.

wine = valpolicella (30%) because Rule-41.

wine = burgundy (30%) because Rule-44.

The Wine Advisor most strongly recommends Riesling, a medium, sweet white wine, and Gamay, a medium, sweet red wine.  This reflects the expert's view that both red and white wines are good with turkey.

You should now see:

M.4>

The M.4 prompt indicates that the consultation is completed.  You are now interacting directly with M.4.  During the consultation you were interacting with the Wine Advisor

Related Topics:

Answering with Unknown

Chicken Parmagiana

Totally Unknown Meal

Meals

Using WHY

Using SHOW and LIST

More About LIST


Answering with Unknown

Sometimes you may not know the answer to a question.  For example you may not know what the main course of the meal is going to be.  M.4 accepts the answer unknown and continues to pursue the best wine based on the answers you are able to give.  You can abbreviate unknown as u.


Chicken Parmagiana

Assume that your dinner is Chicken Parmagiana but you have no preferences about the sweetness of the wine.  Chicken Parmagiana has a tomato-based sauce.

M.4>go

Is the main component of the meal meat, fish, or poultry?

>>poultry

Does the meal have turkey in it?

>>no

Does the meal have a sauce on it?

>>yes

Is the sauce for the meal spicy, sweet, cream, or tomato?

>>tomato

Is the flavor of the meal delicate, average, or strong?

>>average

Do you generally prefer dry, medium, or sweet wines?

>>unknown

wine = cabernet-sauvignon (100%) because Rule-42.

wine = zinfandel (100%) because Rule-42.

wine = gamay (60%) because Rule-33.

wine = pinot-noir (60%) because Rule-43.

wine = valpolicella (30%) because Rule-41.

wine = burgundy (30%) because Rule-44.


Totally Unknown Meal

Use why, show, and unknown as you run consultations to select wines for the following meals.  This section is specifically designed for you to become accustomed to M.4's general behavior.  Experiment with your answers.

If you are unsure about how to classify some parts of the meal, combine answers, for example:

Is the sauce for the meal spicy, sweet, cream, or tomato?

>>sweet cf 60 and spicy cf 50

This means that the sauce is somewhere between sweet and spicy.


Meals

You might try running the Wine Advisor with your own meals, or with some of the following menus:

•	Dover Sole with cream sauce

•	A delicate fish meal.

•	Chicken Maryland

•	Chicken in bread crumbs with no sauce.

•	Chicken Cacciatore

•	Chicken in a tomato and green pepper sauce.

•	Sweet and Sour Pork

•	A meat dish with a sweet sauce.


Using WHY

Run the consultation shown below.  It is for a traditional English Christmas dinner.  For the indicated questions, ask why before answering.  The Advisor will print out an explanation for its reasoning.  The explanation shows the Rule that is responsible for the current question.  Remember not to type a question mark after why.

Look carefully at each Rule to see the correlation between the current question and the Rule.  You should see that the Rules use information that you provide by answering the question.  The goal of the Wine Advisor is to find the best wine; it looks through the knowledge base for the applicable Rules and continues until the recommendations are made.

After each explanation you will be prompted again for an answer.  Use the go command to begin the consultation.

M.4>go

Is the main component of the meal meat, fish or poultry?

>>poultry and meat

Does the meal have veal in it?

>>no

Does the meal have turkey in it?

>>why

M.4 is trying to determine whether the following Rule is applicable in this consultation:

Rule-7:

if main-component = poultry and

   has-turkey = no

then best-color = white cf 90 and

     best-color = red cf 30.

The following entries are also under consideration:

Rule-21 (a Rule)

Rule-33 (a Rule)

Kb-1 (a goal)

Rule-21 says that given the information about the meal, if red wine is the best choice, then recommend a red wine with complete certainty.

Rule-33 says that if the wine to be recommended is red, medium-bodied, and either medium-sweet or sweet, then the type of wine to recommend is Gamay.

Kb-1 establishes that finding types of wine is the goal of the consultation.

Type list best-color to see all the Rules that could conclude best-color.

Does the meal have turkey in it?

>>list best-color

Rule-6:

if main-component = meat and

   has-veal = no

then best-color = red cf 90.

Rule-7:

if main-component = poultry and

   has-turkey = no

then best-color = white cf 90 and

     best-color = red cf 30.

Rule-8:

if main-component = fish

then best-color = white.

Rule-9:

if not(main-component = fish) and

   has-sauce = yes and

   sauce = tomato

then best-color = red.

Rule-10:

if main-component = poultry and

   has-turkey = yes

then best-color = red cf 80 and

     best-color = white cf 50.

Rule-11:

if has-sauce = yes and

   sauce = cream

then best-color = white cf 40 and

     best-color = red cf -90.

Continuing with the consultation...

Does the meal have turkey in it?

>>yes

Does the meal have a sauce on it?

>>yes

Is the sauce for the meal spicy, sweet, cream or tomato?

>>why

M.4 is trying to determine whether the following Rule is applicable in this consultation:

Rule-9:

if not(main-component = fish) and

   has-sauce = yes and

   sauce = tomato

then best-color = red.

The following entries are also under consideration:

Rule-21 (a Rule)

Rule-33 (a Rule)

Kb-1 (a goal)

Let us assume that there is a lot of white pepper in the gravy.

Is the sauce for the meal spicy, sweet, cream, or tomato?

>>spicy

There will be a few moments pause here.

Do you generally prefer dry, medium or sweet wines?

>>why

M.4 is trying to determine whether the following Rule is applicable in this consultation:

Rule-29:

if best-sweetness is unknown and

   preferred-sweetness = dry

then recommended-sweetness = dry.

The following entries are also under consideration:

Rule-36 (a Rule)

Kb-1 (a goal)

Rule-36 says that if a white, medium or full bodied, dry or medium-sweetness wine is recommended, then the wine is Chardonnay.

Do you generally prefer dry, medium or sweet wines?

>>medium

wine = cabernet-sauvignon(98%)because Rule-42.

wine = zinfandel (98%) because Rule-42.

wine = burgundy (98%) because Rule-44.

wine = chardonnay (50%) because Rule-36.

wine = gewuerztraminer (50%) because Rule-39.


Using SHOW and LIST

The show command allows you to examine M.4's record of conclusions made during the consultation.  This record is called the cache and can be inspected both during and after a consultation.  During a consultation it is often useful to see the values that have been concluded thus far.

The list command examines entries in the knowledge base.  List is useful for inspecting the Rule that is currently being applied, as shown below.

When M.4 asks a question, you can use the show or list command.  For the indicated questions, ask M.4 to list a Rule that is relevant to its reasoning, or show the values that expressions have taken on.  After M.4 has responded to either of these commands, it will reprompt you with the current question.  Enter an answer (e.g., red ) to go on.

Start a new consultation for a beef stroganoff meal, and use the show and list commands.

M.4>go

Is the main component of the meal meat, fish, or poultry?

>>meat

Does the meal have veal in it?

>>show main-component

main-component = meat (100%) because you said so.

Does the meal have veal in it?

>>why

Use why to see which Rule is currently being applied.

M.4 is trying to determine whether the following Rule is applicable in this consultation:

Rule-6:

if main-component = meat and

   has-veal = no

then best-color = red cf 90.

The following entries are also under consideration:

Rule-21 (a Rule)

Rule-33 (a Rule)

Kb-1 (a goal)

Use list to look at Rule-21.  At this point in the consultation, M.4 is gathering information about the main component of the meal so that the best color of wine can be determined.

Does the meal have veal in it?

>>list Rule-21

Rule-21:

if best-color = red

then recommended-color = red.

If you encountered a syntax error when typing this command, it may be because you put a space between Rule and 21, instead of a hyphen.

This wine advisor selects the best color of wine depending on the main course.  You can see that the premise of Rule-21 is "driving" the questions about the main component of the meal.  Use list to look at the other Rule that was mentioned.  Then, continue the consultation.

Does the meal have veal in it?

>>list Rule-33

Rule-33:

if recommended-color = red and

   recommended-body = medium and

   (recommended-sweetness = medium or

   recommended-sweetness = sweet)

then wine = gamay.

Does the meal have veal in it?

>>no

Does the meal have a sauce on it?

>>why

M.4 is trying to determine whether the following Rule is applicable in this consultation:

Rule-9:

if not(main-component = fish) and

   has-sauce = yes and

   sauce = tomato

then best-color = red.

The following entries are also under consideration:

Rule-21 (a Rule)

Rule-33 (a Rule)

Kb-1 (a goal)

Does the meal have a sauce on it?

>>yes

Is the sauce for the meal spicy, sweet, cream, or tomato?

>>spicy and cream

Do you generally prefer dry, medium, or sweet wines?

>>show sauce

sauce = spicy (100%) because you said so.

sauce = cream (100%) because you said so.

Do you generally prefer dry, medium or sweet wines?

show reveals that M.4 has noted your answer.  The expression sauce is multivalued, that is, it can take on more than one value with certainty.

From the information you have provided about the meal, M.4 should have determined the best color of the wine for the meal.  Best-color is an expression in the Wine knowledge base.  Ask to see what value has been concluded for best-color.

>>show best-color

best-color = white (40%) because Rule-11.

best-color = red (0%) because Rule-11 and Rule-6.

Do you generally prefer dry, medium or sweet wines?

Take a look at Rules 11 and 6.

>>list Rule-6

Rule-6:

   if main-component = meat and

      has-veal = no

   then best-color = red cf 90.

Do you generally prefer dry, medium, or sweet wines?

>>list Rule-11

Rule-11:

   if has-sauce = yes and

      sauce = cream

   then best-color = white cf 40 and

        best-color = red cf -90.

Rule-6 says that red wines go best with meat meals when the meat is not veal.  This Rule succeeded, and for a time M.4 stored in the cache that best-color = red cf 90.

Rule-11 says that if the meal has a cream sauce, white wine will probably be good with your meal, and red wine should almost certainly not be served.  This Rule succeeded as well, and contributed evidence of -90 against best-color = red.  The evidence balances exactly, and the certainty factor goes to 0.

Do you generally prefer dry, medium or sweet wines?

>>why

M.4 is trying to determine whether the following Rule is applicable in this consultation:

Rule-29:

if best-sweetness is unknown and

   preferred-sweetness = dry

then recommended-sweetness = dry.

The following entries are also under consideration:

Rule-36 (a Rule)

Kb-1 (a goal)

Do you generally prefer dry, medium or sweet wines?

>>show best-sweetness

best-sweetness was sought, but no value was concluded.

Rule-29 says that if the best sweetness for the wine cannot be determined, and the user prefers a dry wine, then recommend a dry wine.

Do you generally prefer dry, medium or sweet wines?

>>list Rule-36

Rule-36:

if recommended-color = white and

   (recommended-body = medium or

   recommended-body = full) and

   (recommended-sweetness = dry or

   recommended-sweetness = medium)

then wine = chardonnay.

Do you generally prefer dry, medium or sweet wines?

>>medium

wine = chardonnay (40%) because Rule-36.

wine = gewuerztraminer (40%) because Rule-39.

Now ask M.4 to show all the values that were concluded in the course of selecting the wines to recommend for this meal.

M.4>show

wine = chardonnay (40%) because Rule-36.

wine = gewuerztraminer (40%) because Rule-39.

recommended-color = white(40%)because Rule-22.

best-color = white (40%) because Rule-11.

best-color = red (0%) because Rule-11 and Rule-6.

main-component = meat (100%) because you said so.

has-veal = no (100%) because you said so.

has-sauce = yes (100%) because you said so.

sauce = spicy (100%) because you said so.

sauce = cream (100%) because you said so.

recommended-body = full(100%)because Rule-16.

best-body = full (100%) because Rule-1.

recommended-sweetness = medium (100%) because Rule-30.

best-sweetness was sought, but no value was concluded.

preferred-sweetness = medium (100%) because you said so.

feature = spiciness (100%) because Rule-13.

Use show and list to trace a conclusion back to a question.

M.4>list Rule-39

Rule-39:

if recommended-color = white and

   recommended-body = full and

   feature = spiciness

then wine = gewuerztraminer.

M.4>show feature

feature = spiciness (100%) because Rule-13.

M.4>list Rule-13

Rule-13:

if has-sauce = yes and

   sauce = spicy

then feature = spiciness.

M.4>show sauce

sauce = spicy (100%) because you said so.

sauce = cream (100%) because you said so.


More About LIST

Use list to search the knowledge base for Rules that conclude a value for a particular attribute.  The following command, for example, lists all Rules that conclude a value for best-body.

M.4>list best-body

Rule-1:

if has-sauce = yes and

   sauce = spicy

then best-body = full.

Rule-2:

if tastiness = delicate

then best-body = light cf 80.

Rule-3:

if tastiness = average

then best-body = light cf 30 and

     best-body = medium cf 60 and

     best-body = full cf 30.

Rule-4:

if tastiness = strong

then best-body = medium cf 40 and

     best-body = full cf 80.

Rule-5:

if has-sauce = yes and

   sauce = cream

then best-body = medium cf 40 and

     best-body = full cf 60.

List those Rules that conclude that white is the best color.

M.4>list best-color = white

Rule-7:

if main-component = poultry and

   has-turkey = no

then best-color = white cf 90 and

     best-color = red cf 30.

Rule-8:

if main-component = fish

then best-color = white.

Rule-10:

if main-component = poultry and

   has-turkey = yes

then best-color = red cf 80 and

     best-color = white cf 50.

Rule-11:

if has-sauce = yes and

   sauce = cream

then best-color = white cf 40 and

     best-color = red cf -90.

list can also be used to print the entire knowledge base:

M.4>list

Listing the entire Wine knowledge base takes a few minutes; <Ctrl-Break> will stop the listing.  Another M.4 command is uses which prints the knowledge base entries that use a specified expression in the premise.  Uses can be entered at the M.4 top level and during a consultation.

M.4>uses feature

Rule-39:

if recommended-color = white and

   recommended-body = full and

   feature = spiciness

then wine = gewuerztraminer.


Modifying The Knowledge Base

You are going to modify the Wine Advisor so that it recommends Retsina for Greek meals such as Moussaka.  As served in Greece, Moussaka is a strongly-flavored lamb dish with a heavy olive oil based sauce.  Retsina has a very sharp taste and it goes especially well with this rather heavy meal.

Related Topics:

Using ADD

A Faulty Conclusion

Fixing the FaultTesting the Change

The Final Test


Using ADD

You will be using the M.4 add command to enter new Rules, add answers, and rewrite questions.


A Faulty Conclusion

Run the following consultation to see if M.4 will conclude Retsina wine.

M.4>go

Is the main component of the meal meat, fish, or poultry?

>>meat

Does the meal have veal in it?

>>no

Does the meal have a sauce on it?

>>yes

Is the sauce for the meal spicy, sweet, cream, or tomato?

Since olive oil is not one of the options, answer that you do not know the sauce, thus:

>>unknownGlossUnknown.262

Complete the consultation:

Is the flavor of the meal delicate, average, or strong?

>>strong

Do you generally prefer dry, medium, or sweet wines?

>>medium

wine = cabernet-sauvignon (90%) because Rule-42.

wine = zinfandel (90%) because Rule-42.

wine = burgundy (80%) because Rule-44.

wine = gamay (40%) because Rule-33.

wine = pinot-noir (40%) because Rule-43.

At this point, the first problem has become manifest; M.4 has not recommended Retsina.  Assume, for the sake of simplicity, that Retsina should be drunk with all Greek meals.


Fixing the Fault

Ask M.4 if there is a Rule which concludes Retsina, and if so, show the Rule.  Use list.

M.4>list wine = retsina

No knowledge base entries satisfy the condition.

There are no Rules which conclude that the wine for the meal is Retsina.  Use add to enter a Rule that if a feature of the meal is Greek, then Retsina is a suitable wine.  The system will generate a unique label (Kb-28 ) for the Rule and report that it was added to the knowledge base.

M.4>add if feature = greek \

M.4>then wine = retsina.

Kb-28 entered at the end of the knowledge base.

Ask M.4 to list the Rule.

M.4>list Kb-28

Kb-28:

   if feature = greek

   then wine = retsina.

The Rule is in the knowledge base.  If you need to correct a misspelling in the Rule, use the add command again.  This time, specify the label (Kb-28) thus:

M.4>add Kb-28: if feature = greek \

M.4>then wine = retsina.


Testing the Change

Run the consultation with the new Rule.

M.4>go

Is the main component of the meal meat, fish, or poultry?

>>meat

Does the meal have veal in it?

>>no

Does the meal have a sauce on it?

>>yes

Is the sauce for the meal spicy, sweet, cream, or tomato?

>>unknown

Is the flavor of the meal delicate, average, or strong?

>>strong

Do you generally prefer dry, medium, or sweet wines?

>>medium

wine = cabernet-sauvignon (90%) because Rule-42.

wine = zinfandel (90%) because Rule-42.

wine = burgundy (80%) because Rule-44.

wine = gamay (40%) because Rule-33.

wine = pinot-noir (40%) because Rule-43.

M.4 has still not concluded Retsina! Take another look at the Rule you added:

M.4>list Kb-28

Kb-28:

if feature = greek

then wine = retsina.

Perhaps M.4 has not found the right value for the expression feature.

M.4>show feature

feature was sought, but no value was concluded.

No value has been concluded for feature.  Use list to see the Rules that conclude a value for the expression feature.

M.4>list feature

Kb-2:

   multivalued(feature).

Rule-13:

   if has-sauce = yes and

      sauce = spicy

   then feature = spiciness.

This Rule does not do what we want; let's put one in that concludes that the meal is Greek.

M.4>add if has-sauce = yes and  \

M.4>sauce = olive-oil and \

M.4>has-lamb = yes \

M.4>then feature = greek.

Kb-29 entered at the end of the knowledge base.

The addition of this Rule affects a portion of the knowledge base.  Change the knowledge base entries that deal with sauce so that it mentions olive-oil, and add a question for lamb.  First list the question that asks about sauce.

M.4>list sauce

Kb-21:

   multivalued(sauce).

Kb-22:

   question(sauce) = 'Is the sauce for the

   meal spicy, sweet, cream or tomato?'.

Kb-23:

   legalvals(sauce) = [spicy,sweet,

   cream,tomato].

Note that knowledge base entries are labelled, i.e., the question for sauce is Kb-22 which can be read as 'knowledge base entry 22'.  Use add to replace Kb-22 with a question that includes olive-oil.  Be sure to type in the single quote marks otherwise a syntax error will result.

M.4>add Kb-22:question(sauce) = \

M.4>'Is the sauce for the meal spicy, sweet, cream, \

M.4>tomato, or olive-oil?'.

Kb-22 replaced in the knowledge base.

Now consider the expected answers (legalvals) for the question:

Kb-23:

   legalvals(sauce) = [spicy, sweet, cream,

   tomato].

Use add again to add olive-oil to the list of expected answers for sauce.

M.4>add Kb-23:legalvals(sauce) = \

M.4>[spicy,sweet,cream,tomato,olive-oil].

Kb-23 replaced in the knowledge base.

Before running a test consultation, review the changes you have made to the knowledge base.

M.4>list wine = retsina

Kb-28:

   if feature = greek

   then wine = retsina.

M.4>list feature

Kb-2:

   multivalued(feature).

Rule-13: if has-sauce = yes and

sauce = spicy

    then feature = spiciness.

Kb-29: if has-sauce = yes and

sauce = olive-oil and

has-lamb = yes

    then feature = greek.

M.4>list sauce

Kb-21:

   multivalued(sauce).

Kb-22:

   question(sauce) = 'Is the sauce for the

   meal spicy, sweet, cream, tomato, or olive

   oil?'.

Kb-23:

   legalvals(sauce) = [spicy,sweet,cream,

   tomato,olive-oil].


The Final Test

Re-run the consultation.

M.4>go

Is the main component of the meal meat, fish, or poultry?

>>meat

Does the meal have veal in it?

>>no

Does the meal have a sauce on it?

>>yes

Is the sauce for the meal spicy, sweet, cream, tomato, or olive-oil?

>>olive-oil

Is the flavor of the meal delicate, average, or strong?

>>strong

Do you generally prefer dry, medium, or sweet wines?

>>medium

What is the value of: has-lamb ?

M.4 has automatically generated a question for the expression has-lamb.  There is lamb in Moussaka so type yes (Type yes completely.  Since we did not specify any legal values for has-lamb, M.4 cannot recognize abbreviated answers.).

>>yes

wine = retsina (100%) because Kb-28.

wine = cabernet-sauvignon (90%) because Rule-42.

wine = zinfandel (90%) because Rule-42.

wine = burgundy (80%) because Rule-44.

wine = gamay (40%) because Rule-33.

wine = pinot-noir (40%) because rule43.

Retsina is now recommended!


Preface to The VINE ADVISOR

The Vine Advisor uses additional M.4 features to encode the same knowledge as the Wine Advisor, but in more compact form.

Related Topics:

Summary of the Vine Advisor

M.4 Features Used in Vine

Sample Consultation with Vine


Summary of the Vine Advisor

Vine is short for "Variables and Wine".  The knowledge in the Vine Advisor is the same as that in Wine.  But Vine accomplishes the same result with eighteen Rules that Wine accomplishes with forty-four Rules.  Here are some of the topics demonstrated in the Vine Advisor:

•	In the Wine Advisor, Rules were used to define the characteristics of wine.  In the Vine Advisor, a table of facts is used.  Facts take the form expression = value and are stored in the knowledge base.  M.4 can use a fact stored in the knowledge base to obtain a value for an expression.

•	The Wine Advisor requests the user's preferences if and when they are needed.  As a result, the consultation may jump from the topic of the meal's characteristics to the user's preferences, and then back to the meal.  The Vine Advisor uses a new meta-fact, initialdata, to identify preferences to be obtained at the beginning of every consultation.

•	You will see some new complexities in the syntax of expressions.  Previously expressions have been of the form best-color or wine whereas in the Vine Advisor there are parenthetical expressions, for example:  wine(red,light,dry).

•	You will see menus of legal answers to questions.  The Vine Advisor illustrates several methods for producing such menus:

•	The automaticmenu meta-fact generates a menu of the legalvals for an expression.

•	The enumeratedanswers meta-fact converts the user's numerical response to a corresponding legal value for the expression.  When paired with the enumeratedanswers meta-fact, automaticmenu produces a numbered menu of legalvals, and answers can be entered either by name or number.

•	Definitions of (or other information about) the legal answers can be displayed in a menu by specifying the menu as part of a question meta-fact.  Such a menu may also be paired with the enumeratedanswers meta-fact to allow answers to be entered by number.

•	automaticmenu and enumeratedanswers meta-facts may apply to a group of similarly-named expressions by using variables in the names of the expressions.


Knowledge Engineering Hints for Vine
M.4 Features Used in Vine

The Variable Wine Advisor, referred to as Vine, contains the same knowledge as the Wine Advisor, but is designed to show how M.4 variables can be used.  In addition, two other M.4 features are used: initialdata, and facts.

Related Topics:

Variables

Facts

Initialdata


Hints for Vine - Variables
Variables

Many of the syntactically equivalent Rules have been compressed into "variableized" Rules, so that in some cases a single Vine Rule can replace up to eight Wine Rules.

Rule-14:

if best-body = light

then recommended-body = light.

Rule-15:

if best-body = medium

then recommended-body = medium.

Rule-16:

if best-body = full

then recommended-body = full.

Rule-21:

if best-color = red

then recommended-color = red.

Rule-22:

if best-color = white

then recommended-color = white.

Rule-26:

if best-sweetness = dry

then recommended-sweetness = dry.

Rule-27:

if best-sweetness = medium

then recommended-sweetness = medium.

Rule-28:

if best-sweetness = sweet

then recommended-sweetness = sweet.

The same Rules compressed into one:

if best-X = V

then recommended-X = V


Facts

In Wine, the Rules used to conclude wine looked like:

Rule-33:

if recommended-color = red and

   recommended-body = medium and

   recommended-sweetness = medium or

   recommended-sweetness = sweet

then wine = gamay.

Almost all of the Rules that conclude "wine" have been replaced by a single Vine Rule that looks for "wine facts".

if recommended-color = C and

   recommended-body = B and

   recommended-sweetness = S and

   wine(C,B,S) = W

then wine = W.

The Vine knowledge base entries for "wine facts" are written thus:

wine(red,medium,medium) = gamay.

wine(white,light,dry) = chablis.

wine(red,light,ANY) = valpolicella.


Initialdata

In Vine, the user's preferences for the color, body, and sweetness of the wine are sought before inferences are made.  The goal of the consultation is still wine, but the initialdata entry ensures that the consultation will always start with questions about the user's preferences.

goal = wine.

initialdata = [preferred-color,

         preferred-body,

         preferred-sweetness].


Sample Consultation with Vine

Here is a sample consultation with the Vine Advisor.  It is for a turkey dinner with a sweet sauce.

M.4> go

Do you generally prefer red or white wines?

   1. red

   2. white

>> 2

Do you generally prefer light, medium or full bodied wines?

   1. light

   2. medium

   3. full

>> 2

Do you generally prefer dry, medium or sweet wines?

   1. dry

   2. medium

   3. sweet

>> 2

What is the main component of the meal?

   1. meat

   2. fish

   3. poultry

>> 3

Does the meal have turkey in it?

   yes

   no

>> yes

Does the meal have a sauce on it?

   yes

   no

>> yes

What kind of sauce does the meal have?

   1. spicy

   2. sweet

   3. cream

   4. tomato

>> sweet

Is the flavor of the meal delicate, average or strong?

>> average

   wine = riesling (85%) because v-Rule-4.

   wine = gamay (76%) because v-Rule-4.

   wine = cabarnet sauvignon (70%) because v-Rule-4.

   wine = zinfandel (70%) because v-Rule-4.

   wine = chardonnay (58%) because v-Rule-4.

   wine = valpolicella (51%) because v-Rule-4.

   wine = burgundy (51%) because v-Rule-4.

   wine = chenin blanc (51%) because v-Rule-4.

   wine = pinnot noir (40%) because v-Rule-4.

   wine = soave (30%) because v-Rule-4.


Preface to ACE

The Air Cargo Expert or ACE provides an example of a simplified, interactive simulation of the loading and the flying of passenger and cargo planes.  This application illustrates the use of procedural and object-oriented programming features in M.4 to represent and manipulate objects.

Running the program allows the user to select or define planes and to perform various operations like load, take_off, ascend, fly, etc.  After each user action, the program updates the plane's state description and displays an appropriate result.  During execution, the user can examine the plane's status or interrogate M.4 for details like the current line of reasoning (why) or the options to the current input request (options).

Subordinate Topics:

Procedures

Object-Oriented Programming

Sample Consultation with ACE


Procedures

The procedures in M.4 give the knowledge engineer the ability to explicitly represent knowledge that is best captured as ordered steps or iterations of steps that solve a problem.

M.4 procedures make it easier for the knowledge engineer to direct the expert system's flow of control, iterate over information, execute M.4 commands, perform mathematical calculations, and display text.  In addition, using the C programming language like syntax of M.4 procedures from within the body of a procedure, the programmer can create object class instances, send messages to object instances, seek expressions, call other procedures and call the same procedure recursively.

In the ACE Sample Knowledge System  procedures are used primarily for processing messages sent to objects (i.e., methods) and to control the flow of control.


Object-Oriented Programming

For this problem domain, the knowledge engineer chose to organize the knowledge around objects and the operations that can be performed on and by those objects.  This differs from conventional programming approaches where the knowledge is organized around the strategies or steps involved in solving a problem.

One advantage provided by an object-oriented design is the ability to encapsulate data and procedures.  This is accomplished through the definition of object classes, which are defined by describing the objects unique attributes, its relationship to other objects and the set of messages that it will accept (i.e., procedures that manipulate the objects and their attribute values).

The attributes of an object are considered to be encapsulated because they can only be accessed by methods that are members of the same class.  This also implies that the same method name could be accessed by different classes with correct results.  The built in methods provided by M.4 are examples of this; sending the 'new' message to any class correctly creates the appropriate instance.

Likewise, methods can be accessed across classes.  The knowledge engineer can define methods using the same name.  For example, the 'load' method is used in both the cargo_plane and passenger_plane classes.  In this case the class membership of each object determines which method is used.

Another advantage of using an object-oriented design is code re-use, which frequently occurs when one object class is derived from one or more other classes.  In ACE, the airplane class is derived from both the moving_object class and the means_of_transportation class, which causes the airplane class definition to be composed of the attributes and methods from both its super classes as well as the methods and attributes unique to the airplane class (See Figure 20-1).


Sample Consultation with ACE

In order to run the ACE sample knowledge system simulation the user must type or select the M.4 'go' command.  At any request for input, the user can use the 'options' input to determine the legal values for the response.  Also, note that multiple word entries separated by spaces must be enclosed in quotes.

M.4> go

Welcome to the Flight Simulator.

Would you like to fly a cargo or

a passenger plane?

>> cargo

Would you like to fly a known plane or specify a new plane?

>> new

What is the name of the plane?

>> relief_1

Plane characteristics are:

INSTANCE: cargo_plane_3

   CLASS: cargo_plane

   SLOTS:

     tonnage_capacity

     cargo = []

     airplane_id_number

     name = relief_1

     altitude = 0

     x_position = 0

     y_position = 0

     x_velocity = 0

     y_velocity = 0

     arrival_time

     departure_time

     carrying_capacity

     fuel_capacity

What is the next action you wish to take?

>> load

What cargo do you wish loaded?

>>"medical supplies"

Loading relief_1 with medical supplies.  Cargo now is: [medical supplies]

What cargo do you wish loaded?

>>"water purifiers"

Loading relief_1 with water purifiers.  Cargo now is: [water purifiers,tents,food,medical supplies]

What is the next action you wish to take?

>> take_off

What is your flying speed (in mph)?

>> 225

What is the time for ascent, in hours?

>> .3

To what altitude do you wish to ascend, in feet? (answer unknown if you prefer to specify angle)

>> 10000

The required ascent velocity is 6.31313 mph.

New position is: X = 67.4734 miles,  Y = 1.89394 miles.

 Altitude = 10000.0 feet.

What is the next action you wish to take?

>> fly

What is your flying speed (in mph)?

>> 600

What is the flying time at this speed, in hours?

>> 11

New position is: X = 6667.47 miles,  Y = 1.89394 miles.

 Altitude = 10000.0 feet.

What is the next action you wish to take?

>> land

What is your flying speed (in mph)?

>> 250

What is the time for descent, in hours?

>> .2

The required descent velocity is -9.4697 mph.

New position is: X = 6717.44 miles,  Y = 2.22045E-16 miles.

 Altitude = 1.1724E-12 feet.

What is the next action you wish to take?

>> unload

Unloading relief_1.  Cargo is: [water purifiers,tents,food,medical supplies]

What is the next action you wish to take?

>> stop

Finished simulation.

M.4> log off


Preface to Banker

The Banker is an example of a knowledge system.  The knowledge source was a collection of brochures.  In contrast, a system that advises on personal investments, for example, would likely be an expert system.  For this, a human expert is needed, and the resulting expert system represents only the knowledge of that particular human expert.

The selection of the appropriate bank account for a customer is based on three customer characteristics: the banking services desired, the initial deposit, and the anticipated account activity.  From this initial information, the customer's account requirements can be ascertained and the corresponding account or combination of accounts can be selected.  The customer supplies the initial information by responding to questions.  If the customer is already familiar with the services of the bank, they are not explained.  However, other customers may desire a detailed explanation of the services before making a decision.

The customer may take advantage of certain account features such as checking, savings, automatic deposit, phone transfer, automatic transfer, and auto teller services.  Candidate accounts are chosen based on the services desired, the minimum balance, a projected average balance, and the projected account activity.  Accounts are selected from the candidates.  Banker may recommend both a checking and a savings account.

Related Topics

A Sample Consultation with Banker


Sample Consultation with Banker
A Sample Consultation with Banker

M.4>go

*-* Welcome to the Bank Services Advisor *-*-*-

This new intelligent computer system will help you to select the services ofour bank that are most appropriate for you.  To determine the services that best fit your needs, the system will ask you a series of questions to develop a profile of your banking requirements.  It will then make recommendations about how you can most effectively utilize the many services of our bank.

Please type your answers to the questions on the keyboard located below the screen.  If you are unsure of the answer to a particular question, simply type "unknown".Enter all dollar amounts to two decimal places.

Are you generally familiar with the services our bank provides?

>>no

Thank you for giving us the opportunity to explain our special services.  You will see a brief description of each service before you are asked if you want the service.

* * * * * * * * * * * * * * * * * * * * * * *

We offer many different styles of checks and check books to suit your check writing needs.

Do you want to be able to write checks?

>>yes

One of our most convenient services is automatic deposit - of your paycheck, Social Security or other government checks, or other regularly-paid income such as annuities.

Do you want automatic deposit services?

>>yes

One of our popular services is automatic transfer of funds to pay bills which are due at the same time and in the same amount every month -loan payments, for example.

Do you want automatic transfer service?

>>yes

Our bank offers a new phone transfer service which allows you to pay bills by merely punching buttons on your touch-tone phone.

You can pay bills for most utilities, most major credit cards, telephone service, many department and chain stores, many insurance carriers, and others.

There are no special fees for this service; thus, you will save time and postage.  As a bonus, all of our auto-teller services are available to you.

Do you want our new phone transfer service?

>>yes

How much will you deposit initially?

>>10000.00

How many deposits do you expect to make each month(including any automatic deposits)?

>>2

What is the average amount that will be deposited?

>>2000.00

How many cash withdrawals do you expect to make at the bank each month (not including any auto teller withdrawals)?

>>0

How many cash withdrawals do you expect to make at an automatic teller each month?

>>1

What is the average amount of each auto-teller withdrawal?

>>100.00

How many automatic transfers (e.g., to pay loan accounts) do you expect to make each month?

>>5

What is the average amount of each automatic transfer?

>>100.00

How many checks will you be writing each month?

>>15

What is the average amount of each check?

>>50.00

In the worst case, your balance during the month could become as low as $8650.00.

Do you approve this worst case minimum balance? (If you say no,you will be asked to enter a different figure for minimum balance.)

>>no

Practically speaking, what do you think your minimum balance will be?

>>10000.00

A combination of checking and savings accounts may satisfy your needs best.

Do you want such a combination of accounts?

>>yes

[Considering best savings account...]

A time deposit account may be appropriate for you.  Such an account requires you to leave your initial deposit in the account for a specified time period, usually some months long (ranging from one week to five years).  You may withdraw interest when it is paid (usually monthly or quarterly), or leave it to be reinvested, but you may not withdraw any of the principal (initial deposit) without severe interest penalties.

Do you want a time deposit account?

>>yes

What is the longest time period you would consider for a time depositaccount? In other words, what is the longest time you would be able to leave your money in the account without withdrawals, except for interest?

(Please specify a number followed by: days, weeks, months, or years.)

>>6 months

[Considering best checking account...]

Recommended account: time_deposit(2).   This account is a time deposit account with a term of seven days.   If you can limit yourself to depositing and withdrawing funds only on a particular day of the week (e.g., Monday), and only in person at the bank or by mail, this is a good choice.  If you need more flexibility, try one of the interest-bearing checking accounts.

Recommended account: money_market_checking

This account is an interest-bearing checking account. It has a higher rate of interest than our regular interest checking account and requires a higher minimum balance.  Unlike our interest-bearing limited checking account, you may write an unlimited number of checks.

What would you like to do next?

1.  Quit this consultation

2.  Start a new consultation

>>1


Glossary of Terms

Special Note:

After you go to a specific letter, you can return to this screen immediately by clicking the [Back Button]...


A

Architecture

Atom

Auto-Completion

Automatic Question


B

Backtracking

Bind, Binding, Bound

Boolean Connectives

Breadth-First Search


C

Cache

Case

Certainty Factor (CF)

Class

Code Hooks

Conclusion

Conjunction

Conjunctive Conclusion

Control


D

Declarative Knowledge

Declarative Semantics

Deep Knowledge

Definite

Depth-First Search

Disjunction

Domain

Dual Semantics


E

End-User System

Expert

Expertise

Expert System

Explanation

Expression

Extensible

External Function


F

Fact

First Principle

Forward-Chaining

Functor


G

Goal

Goal-Directed Reasoning


H

Heuristic


I

Inference

Inference Engine

Inference-Tracing Mechanism

Infix Operator

Inheritance

Instance

Instantiation

Invoke A Rule


J

Justification


K

KB, KB ENTRY, KBS, KE, KS

Knowledge

Knowledge Acquisition

Knowledge Base

Knowledge Base Browsing

Knowledge Base Entry

Knowledge Base Language

Knowledge Base Listing

Knowledge Base Patcher

Known

Knowledge System


L

Legal Responses


M

Message

Meta-

Meta-Fact

Meta-Proposition

Method

Modus Ponens

Monotonic Reasoning

Multivalued


N

Negation


O

Object

Overlay Mechanism


P

Panels

Panels Mode

Postfix Operators

Prefix Operator

Premise

Presupposition

Procedural Knowledge

Procedural Semantics

PROLOG

Prompt

Proposition


Q

...letter not being used


R

Rule


S

Scheduling

Seek

Semantic

Semantics

Simple Fact

Single-Value Cutoff

Slot

Subclass

Superclass

Surface Knowledge

Symbolic Programming

Syntactic


T

Term

Trace


U

Uninstantiated

Unique

Universal Instantiation

Unknown

User Interface

User-Defined Syntax


V

...letter not being used


W

Working Memory


X

...letter not being used


Y

...letter not being used


Z

...letter not being used


Architecture

The basic organization or problem-solving approach employed by a knowledge system application or tool. Structured selection is an example of an architecture.


Atom

In M.4, the indivisible unit of the language, analogous to a single word in English. For example, best-color is a structure composed of two atoms, best and color, joined by a hyphen.


Auto-Completion

In M.4, a feature that allows a user to type only the first few characters of a response. The characters must be sufficient to distinguish that response from all others that are permissible at that point. A synonym is token completion.


Automatic Question

In M.4, the "automatic question" facility generates a question in the form of: What is the value of: EXPRESSION? when there is no knowledge base  entry that could be used to conclude a value for the EXPRESSION being sought. noautomaticquestion(EXPRESSION) disables the use of the automatic question facility for EXPRESSION.


Backtracking

A search procedure that makes guesses at various points during problem solving and returns to a previous decision point to make another choice when a guess leads to an unacceptable result. In M.4, backtracking occurs when the inference engine returns to try alternative instantiations of variables or to test other clauses of a disjunction.


Bind, Binding, Bound

In M.4, a variable is bound when it is instantiated to (or replaced by) a particular term. Variables may be bound, unbound, and then bound again through the process of backtracking. The term which replaces the variable is called the variable's binding of instantiation.


Boolean Connectives

Boolean connectives are syntactic operators that join simpler propositions to form compound propositions. In M.4, and, or, and not are the available Boolean connectives.


Breadth-First Search

Breadth-first search refers to a strategy in which all of the Rules or objects on the same level of a hierarchy of Rules or objects are examined before any on the next lower level are checked. See also depth-first search.


Cache

In a computer system, caching refers to storing information so that it can be accessed quickly. Cache storage is managed so that most-often-used  entries are readily available. In M.4 the cache is the repository of all conclusions  made in a consultation. See working memory.


Case

A particular problem for which a knowledge system can perform its task. For example, a car diagnosis system might find the cause of a charging problem in Frank Smith's Chevrolet. Cases are used to develop, expand, and evaluate the performance of knowledge systems.


Certainty Factor (CF)

A number representing the confidence placed by a user or knowledge system in the validity of a proposition, hypothesis, or Rule. The number is  not interpreted as a probability, but rather as a subjective index of the amount of evidence that has accumulated confirming the proposition. Confidence factor, cf, certainty, and certainty factor are terms used interchangeably.. In M.4, certainty factors range from -100 to 100 (from definitely ruled out to definitely certain).


Class

A template for defining the methods and variables for a particular type of object. all objects of a given class are identical in form and behavior but contain different data in their slots.


Code Hooks

Code Hooks is an informal phrase that refers to M.4's external function interface. M.4 allows you to access or "hook to" code that is external to M.4.


Conclusion

1.	The consequent portion of a Rule. See Rule.

2.	The portion of a Rule that specifies what will be recorded in the cache.

3.	The cache entry that M.4 makes when a Rule succeeds.


Conjunction

A proposition consisting of two or more simpler propositions connected by the logical operator and. For example, healthy and wealthy is a conjunction.


Conjunctive Conclusion

Rules may contain the Boolean operator and, for example, if healthy then state = wealthy and state=wise. In M.4, conjunctive conclusions may not conclude values for more than one expression.


Control

Refers to the overall order of problem-solving activities in a knowledge system. Along with representation and inference, control is one important dimension of a knowledge system. One example of a control strategy is goal-directed reasoning.


Declarative Knowledge

Knowledge that states what relationships are true among various entities. A language for expressing definitions and correlations is used for declarative knowledge. Often used in contrast to procedural knowledge.


Declarative Semantics

The factual interpretation of knowledge base entries, without regard to the manner in which they will be processed by any inference engine. Thus, a Rule of the form if a and b then c is interpreted declaratively as expressing the fact that if a and b are both true then c is also true. Declarative semantics contrasts with procedural semantics.


Deep Knowledge

Knowledge of basic theories,  first principles, axioms, and facts about a domain. Deep knowledge contrasts with surface knowledge.


Definite

Known with certainty. In M.4, a fact is definite if the expression has a value with a certainty factor of 100.


Depth-First Search

In searching through a hierarchy of objects, depth-first search refers to a strategy in which the next object to be examined is always chosen from among the immediate subordinates (if there are any) of the previously examined object. Only if the previously examined object has no subordinates does the search turn to objects at or above its level in the hierarchy,. M.4 searches the hierarchy of Rules and facts in a depth-first manner.


Disjunction

A disjunction is a proposition that consists of two  or more (simpler) propositions connected by the logical operator or. For example main-component = fish or main-component = poultry is a disjunction:


Domain

A field, discipline, or area of human activity or scholarship such as mathematics, medicine,  physics, auto mechanics, etc. Existing knowledge systems perform specialized tasks within domains. No system yet offers advice about an entire domain.


Dual Semantics

The semantics of a language is its meaning. A knowledge base written for M.4 has dual semantics, that is, it can be interpreted in two ways: declaratively and procedurally. Declarative semantics are the truthful facts and relationships about the subject domain and task. These facts are expressed by the individual knowledge base entries. Procedural semantics describe the sequence of events that will occur when the inference engine processes the knowledge base. See procedural semantics and declarative semantics.


End-User System

1.	A knowledge system that helps or advises a user in a way that parallels the way a human consultant advises a client. The knowledge system may ask questions of the user to gather information  from which to infer appropriate advice. Some consultation systems (including knowledge systems developed using M.4) are able to explain their reasoning so that the user can judge its reliability.

2.	An executable knowledge system generated by the M.4 make command.


Expert

A human who can solve problems or perform actions requiring unusual or uncommon skill. The expert's skills are likely to have evolved slowly, and usually require extensive knowledge and lengthy experience. See expertise.


Expertise

The set of capabilities that underlies the high performance of human experts, including extensive domain knowledge, heuristic Rules that simplify and improve approaches to problem-solving, meta-knowledge, and compiled forms of behavior that afford great economy in skilled performance. Expert knowledge is rare, seldom explicit or measurable, and difficult to communicate or acquire. Gained through experience, long periods of training, apprenticeship and observation, it may be organized  in subtle and idiosyncratic ways.


Expert System

A knowledge system that performs at or near the level of human experts. The system achieves high levels of performance on tasks that, for human beings, require years of special education and training. Often the use of this term is synonymous with knowledge system. However, we make the distinction that an expert system is a special kind of knowledge system, one that uses knowledge acquired from an expert rather than from other sources.


Explanation

Motivating, justifying, or rationalizing an activity by supplying information about goals sought or heuristic Rules applied during the course of the activity.


Expression

In M.4, a combination of alphabetic and numeric characters used to represent concepts or objects. See fact.


Extensible

An extensible language or tool is one that is capable of being extended. For example, the English language may be extended by defining new words. M.4's grammar may be extended with user defined syntax.


External Function

In M.4, the external meta-proposition can be sued to access assembly or C functions outside of M.4. It is also possible to build interfaces between M.4 and other high-level programming languages.


Fact

Assertion, proposition, or belief. In M.4, a fact is an association of an expression with a value. For example the fact best-color = red associates the expression best-color with the value red. Facts may be qualified by certainty factors and stored in the cache. See proposition


First Principle

Any axiom, law, or abstraction representing the highest possible degree of generalization. The laws of gravity are an example of first principles in the domain of physics.


Forward-Chaining

A reasoning strategy in which the  premises  of Rules are tested against the current set of known facts to determine which Rules can immediately be applied to yield new conclusions. One or more eligible Rules are then selected, their conclusions are added to the pool of known facts, and another cycle is begun. In M.4, the whenfound and whencached meta-facts provide forward-chaining.


Functor

In M.4, an atom that joins several terms, called its components, to form a compound term. In parenthetic notation for specifying compound terms, the functor is written first, followed by the components, separated by commas, in parentheses. Functors that apply to just one or two components can be written in operator notations. See prefix, infix, and postfix operators.


Goal

The result or achievement toward which effort is directed. In M.4, a goal is an expression for which a value is being sought. The goals of a consultation are declared in an M.4 knowledge base using the goal meta-fact.


Goal-Directed Reasoning

A control strategy often used for consultation systems. Candidate solutions to a problem are considered and evidence is gathered to determine whether each is acceptable. See backward-chaining.


Heuristic

A Rule of thumb, strategy, trick, simplification, or any other kind of device that drastically limits search for solutions in large problem spaces. Heuristics do not guarantee optimal solutions, in fact, they do not guarantee any solutions at all. But a heuristic offers solutions that are good enough most of the time.


Inference

The process of deriving new facts from known ones. The method of inference defines the one-step derivations that are legal with respect to a given representation in knowledge system. Examples of inference methods are modus ponens and inheritance. Together with representation and control, inference is one of the three dimensions of a knowledge system.


Inference Engine

That portion of a knowledge system that reasons over the knowledge base to arrive at conclusions. The inference engine explains how and why it arrives at a conclusion or asks for information. It also manages the inheritance and the propagation of certainty factors.


Inference-Tracing Mechanism

In M.4, a trace facility for the knowledge engineer. The tracer displays expressions that are being sought, Rules that are invoked, conclusions that are noted, and other events in the inference process.


Infix Operator

A syntactic operator that is written between two terms to form a compound term. For example, to denote the sum A plus B, we might use "+" as an infix operator: A+B. In M.4, some infix operators are used just to make Rules more legible, For example, city of London uses the user-defined infix operator of. See  prefix operator and postfix operator.


Inheritance

A mechanism whereby classes can make use of the methods and slots defined in all classes above them on their branch of the class hierarchy.


Instance

A term used to  refer to an object that belongs to a particular class. For example, California is an instance of the class state.


Instantiation

1.	An object that fits the general description of some class or, specifically, a pending process that associates specific data objects with the parameters of a general procedure.

2.	A variable's instantiation is its binding. See binding.


Invoke A Rule

The process of testing a Rule. In M.4, when the Rule is invoked, the inference engine tests whether the premise of the Rule is true. If so, then the Rule is said to succeed, and its conclusion is noted in the cache.


Justification

In M.4, the relationship between a conclusion and the facts from which it was inferred. Justifications provide a record of the manner in which conclusions are derived from prior data and conclusions.


KB, KB ENTRY, KBS, KE, KS

Abbreviations for knowledge base, knowledge base entry, knowledge-based system, knowledge engineer, and knowledge system, respectively.


Knowledge

Propositions and heuristic Rules. Those kinds of data that can improve the efficiency or effectiveness of a problem solver, Types of knowledge can be distinguished in many dimensions such as: symbolic vs numeric, factual vs heuristic, imperative vs declarative, deep vs shallow.


Knowledge Acquisition

The extraction and representation of knowledge derived from current sources, especially from experts. The activity of transferring or transforming the knowledge and skills from a human expert or other knowledge source into a form usable by a knowledge system. Knowledge acquisition often involves chunking or parsing an expert's knowledge into a collection of if-then Rules.


Knowledge Base

The portion of a knowledge system that contains factual knowledge and heuristics about the domain.


Knowledge Base Browsing

Examination of the knowledge base.


Knowledge Base Entry

A knowledge base entry is a single statement in the knowledge base. In M.4, this statement may be a Rule, fact, or metafact.


Knowledge Base Language

A collection of syntactic forms or Rules that tell you how to write legal statements, functions, or programs that embody knowledge.


Knowledge Base Listing

The hard-copy or on-line listing of a knowledge base. Since the knowledge base is completely independent of the M.4 inference engine, it can be listed on a line printer or examined on-line using a text editor.


Knowledge Base Patcher

In M.4, a facility that allow you to add and remove kb entries during a consultation.


Known

An expression in M.4 is considered known if the expression has a value whose certainty is equal to or greater than 20.


Knowledge System

Computer software that embodies knowledge, usually comprised of an inference engine, a knowledge base, and a user interface. The knowledge system may embody expertise that would qualify it as an expert system; however, systems with more common or limited knowledge are also typical.

A knowledge system built with M.4 includes the M.4 inference engine, a knowledge base, the M.4 or customized user interface, and possibly some conventional programs or functions that are accessed through the external interface or language extensions.


Legal Responses

A legal response is an answer in the expected form. For example, if the legal response to a question has been specified to be a real number, an integer would not be a legal response. In M.4, legalvals is a meta-fact used to specify the legal responses to a question.


Message

A signal from one object to another that requests the receiving object to carry out one of its methods.


Meta-

A prefix that generally indicates that a term is being used to talk about a system rather than being used within the system. For example, a meta-Rule is a Rule that guides the selection and execution of ordinary Rules. It is a Rule about Rules, and thus lies outside the system of Rules themselves.


Meta-Fact

In M.4, meta-facts are facts about the knowledge base or the consultation, as opposed to facts about the subject domain. For example, the meta-fact goal=wine is not part of the knowledge about wines, but is a statement about the consultation, i.e., that the goal of the consultation is to select a wine.


Meta-Proposition

In M.4, meta-propositions are propositions about the knowledge base or about the state of the consultation. For example, the meta-proposition best-color is unknown tests whether M.4 is able to deduce a value for best-color in the current consultation.


Method

A procedure contained within an object that is made available to other objects for the purpose of performing actions for that object.


Modus Ponens

A Rule of inference that states: if A then B is true, and A is true, you can infer that B is true.


Monotonic Reasoning

A reasoning process based on the assumption that once a fact is determined it cannot be altered during the course of the reasoning process.


Multivalued

Allowed to have more than one value with definite certainty. When an expression is specified to be multivalued, M.4 will continue to seek values for that expression even after one definite value has been found. See single-value cutoff.


Negation

A proposition formed by prefixing the word not to a simpler proposition. Thus, not(sauce=spicy) is a negation.


Object

A software packet containing a collection of related data (in the form of slots) and methods for operating on that data.


Overlay Mechanism

In M.4, a facility provided by the load command to load a knowledge base in segments. A newly-loaded segment replaces, or overlays, previously-loaded segments.


Panels

An M.4 debugging facility in which the top half of the screen is configured with windows. each window shows one piece of the inference process, I.e., the invocation/success/failure of knowledge base entries, the expressions currently being sought, the conclusions being put into the cache, and the possible answers for the current question.


Panels Mode

Panels mode refers to running M.4 with the panels turned on.


Postfix Operators

A syntactic operator that is written after a term to form a compound term. For example, if grams is a postfix operator, the 10 grams is a compound term. See also infix operator and prefix operator.


Prefix Operator

A syntactic operator that is written before a term to form a compound term. For example, if the is a prefix operator, then the building is a compound term. See also infix operator and postfix operator.


Premise

The "IF" part, or antecedent, of a Rule. The premise is an arbitrary proposition that can be evaluated during backward- (or  forward-) chaining. See Rule.


Presupposition

A condition that must be true in order for some other statement to even make sense. For example, it must have been raining for the question "Has it stopped raining?" to make sense. In M.4, the presupposition meta-fact can be used to prevent M.4 from seeking the value of a given expression unless its presupposition is true.


Procedural Knowledge

Knowledge of how to do something; for example, the order of steps to be followed in assembling a motor. Often used in contrast to declarative knowledge.


Procedural Semantics

The interpretation of knowledge base entries in terms of the actions they will cause the inference engine to take in the course of a consultation. For example, the M.1 inference engine interprets the Rule if a and b then c to mean "if the current goal is to prove that c is true, then first try to prove that b is true. If not, then stop, but if so, then conclude that c is true." Other inference  engines might proceed differently. See also, delarative semantics.


PROLOG

A programming language based on mathematical logic used to create knowledge systems and knowledge engineering tools, The name comes from "programming in logic."


Prompt

A prompt on the terminal screen invites you to type something in. Standard M.4 prompts include these: M.4> and >>. In response to the prompt you can type a command or an answer to a question.


Proposition

1.	Fact, belief, or assertion. A proposition is a statement that can either be true or false.

2.	In M.4, propositions have a particular syntax, as described in this manual. They generally occur as the premise of a Rule, but can occur in certain meta-facts such a s presupposition and meta-propositions such as listof.


Rule

A pair, composed of an antecedent (known as the premise) and a consequent (known as the conclusion), that can support the deductive process of modus ponens. Rules are of the form: if <premise> then <conclusion>. The premises and conclusions are made up of propositions. A Rule-based system is a system employing if-then Rules in its representation of knowledge.


Scheduling

Determining the order of activities for execution, usually based on control heuristics.


Seek

In M.4, to try to find the value of an expression. Seeking is the primary activity of the M.4 inference engine.


Semantic

Pertaining to the meaning, intention, or significance of a symbolic expression, as opposed to its form. (Contrast syntactic).


Semantics

The interpretation of meaning of a symbolic expression. See declarative semantics, procedural semantics.


Simple Fact

In M.4, a simple fact is a fact without a certainty factor.


Single-Value Cutoff

Refers to M.4's behavior when it finds a definite value for an expression. No more values will be sought unless the expression is specified to be multivalued. See multivalued.


Slot

A storage place within an object for a data element (value).


Subclass

A class that is a special case of another class. For example Fox is a subclass of mammals.


Superclass

A class that is higher in the class hierarchy than another. For example mammal is a superclass of fox.


Surface Knowledge

Experiential or heuristic knowledge. Knowledge that is acquired from experience and is used to solve practical problems. Surface knowledge usually involves specific facts and theories about a particular domain or task and a large number of Rules-of-thumb.


Symbolic Programming

Manipulating symbols that represent objects and relationships. By contrast, data reduction, data-base management, and word processing are examples of conventional or numerical programming. Knowledge systems depend on symbolic programming to manipulate strings of symbols with logical rather than numerical operators.


Syntactic

Pertaining to the form or structure of a symbolic expressions, as opposed to its meaning or significance. (Contrast semantic).


Term

In M.4, a constant, variable, or structure.


Trace

See inference tracer.


Uninstantiated

Not instantiated. See instantiation.


Unique

In M.4, an expression has a unique value if exactly one value for the expression is concluded with a certainty factor of 20 or more.


Universal Instantiation

The Rule of inference that allows a variable to be replaced by an arbitrary term. See instantiation.


Unknown

In M.4, an expression is considered unknown if no potential value has a certainty factor of 20 or more.


User Interface

One subsystem of a knowledge system (or any computing system) with which the human user deals routinely. It aims to be as "natural" as possible, employing language as close as possible to ordinary language (or the stylized language of a given field) and understanding and displaying images, all at speeds that are comfortable and natural for humans. Other subsystems in a knowledge system are the knowledge base and the inference engine.


User-Defined Syntax

M.4 allows users to modify syntax by declaring prefix, infix, and postfix operators.


Working Memory

In expert systems, working memory comprises all of the expression-value relationships that are established while the consultation is in progress. Since the system is constantly checking Rules and seeding values, all values that are established must be kept immediately available until all the Rules have been examined. In M.4, the cache is used as working memory.


Delivery/Demo Environment

The M.4 VB delivery environment is a generic interface that provides communication with the M.4 inference engine, without allowing access to development features.  This interface is easy for end users to understand and interact with.  The menus, commands that appear in the menus, the Why and Unknown buttons, and the screen title can be modified by the developer using the Configure End User I/F selection on the Options menu.

This demo disk presents a type of end-user system taken from M.4 Visual Basic.

Related Topics:

The Delivery End User Screen

Standard Menus

Dialog Boxes


The Delivery End-User Screen
The Delivery End User Screen

The Delivery End User screen at a minimum is made up of a Consultation display, and Go, Restart, Stop, OK, and Cancel buttons.  In addition a question window and selection or input boxes appear on the Delivery End User screen.  This screen is provided as a generic interface with minimal configuration capability for knowledge engineers that do not have the Microsoft Visual Basic Professional Toolkit.

Delivery End User Screen

Consultation Display	This display is used to present information to the end user.  Any text appearing in a display metaproposition is shown exactly as formatted.  Conclusions reached at the end of a consultation are displayed after the last question is answered by the end user.  In addition any help information that is specified by the knowledge engineer appears in the Consultation display.
Consultation Control Buttons and the End Test Control box	There are four Control buttons Go, Restart, Stop, and Cancel.  Go is used to start a consultation after a knowledge base has been loaded.  Restart performs the same action as Go, but it preserves and uses the cache from the previous consultation session.  Because Restart reuses the previous cache the consultation will start with the last question asked right before the previous consultation ended.  If the previous consultation is completed, Restart will appear to do nothing, but if the previous consultation is canceled early, then the new consultation will resume with the last question asked.  The Stop button will end a consultation as soon as a stable state exists.  The Cancel button ends a consultation and the current session with M.4 VB, immediately.
Menu Bar	The menus that appear on the Delivery End User screen can be specified by the developer using the Configure End User I/F selection from the Options menu in the Development environment.  Menu items that appear on menus can also be specified.  The only restriction on specification of menus and menu items for the Delivery End User screen is that they must be a subset of the menus that appear on the Development End User screen.  Menu items, as well, must be chosen as a subset of the menu items that appear on each respective menu on the Development End User screen.
Response Window	If question text is supplied by the developer, the end user will see one of three question displays.  The three types of question displays available are Multi-select, Single-select, and Input.  In both of the Select question windows, the end user responds to a question by selecting one answer in the Single-select question window or one or more answers in the Multi-select question window.  After the answer or answers is selected it is accepted by clicking on the OK button.  Another way to answer a question is by double clicking on the appropriate answer.  To the right of these displays appears a Certainty Factor window for modifying the certainty factor associated with each answer.  In order to respond to an Input question box, first type the response in the input field and then click on the OK button or hit the carriage return.  The type of answer that needs to be entered in the input box is specified above the box (i.e., "Type: an integer").
Other options are available in all three question boxes.  Configurable buttons are available to respond with the answer UNKNOWN or WHY.  See the description of the Configure End User I/F menu item on the Options menu.


Standard Menus

Standard menus appear in the menu bar at the top of all the screens in M.4 VB.  This menu bar contains six selectable menus,

File

Edit

Options

Browse

Window

Help

Options on these menus are selectively grayed to indicate that a particular operation is not available.  If the user selects an option that is grayed, a clicking sound is heard and no operation occurs.

Selection names in dark grey font (like this) are not available in this demonstration version.


File Menu

The File menu provides the developer with access to operations that relate to system files, such as creating, loading, and saving.  Additionally, the file menu can be used to exit M.4 VB.

New	Resets the development and delivery environments.  Selecting New performs the same action as resetting the KB, resetting the Cache, and resetting internal information for the development and delivery environments.
Open...	Produces a dialog box that assists the developer in finding and loading a knowledge base, knowledge system or cache file.
Save As...	Opens a dialog box that allows the developer to save either a knowledge system, knowledge base or cache as a file.
Exit	Exits the M.4 program.  A prompt will appear providing an opportunity to save before exiting.


Edit Menu

The Edit menu provides the developer with the ability to manipulate knowledge base or cache information.  Using the Edit menu, information in the knowledge base can be added, deleted, edited or reset.  Information in the cache can be either set or reset.

Entry...	Opens up an editor window containing the internal representation of the currently selected KB entry.  From the editor window knowledge base entries can be replaced, added (top or bottom), or deleted.  Edit KB Entry is normally used to make minor modifications to the loaded knowledge base.
Warning: This utility is provided to make it easy to see the effect small changes have on the knowledge system.  Do not use this facility for performing extensive modifications to your knowledge base.  If you wish to make significant modifications, use the KB editor to change the knowledge base file, save it, and then reload.  If you need to see different behavior based on significant changes, save the knowledge base under a different name and then load and run each knowledge base successively.

KB File...	Performs the same operation as the Edit Navigation button.  Transfers the developer to the KB Text Editor with the current knowledge base file loaded in the editor.  The current default editor is Windows Write.  If the default editor is used, then the developer will be presented with a selection window with the question "Convert to Write format?" appearing in it.  There are three possible answers to the question, Convert, No Conversion, and Cancel.  If you still want to edit the knowledge base file, then select No Conversion.  If another editor is specified using the Options Select Editor selection, then the selected editor will be used.
KB...	Clears the entire knowledge base from memory.  After Reset KB is selected there is no internal representation of the knowledge base loaded and attempting to start a consultation will result in an error message appearing.  A prompt box will appear informing you that the entire knowledge base is about to be reset.  You can either continue or cancel.
Reset Cache...	Clears the entire cache from memory.  After Reset Cache is selected there is no information in the cache..  A prompt box will appear informing you that the entire cache is about to be reset.  You can either continue or cancel.
Set Cache Expression...	Opens up a prompt box in which to enter the expression to be added or set in the cache.
Reset Cache Expression...	Opens up a prompt box in which to enter the expression to be removed or reset in the cache.


Options Menu

The Options menu provides the developer with the ability to use a variety of debugging, testing, and configuration utilities.  Using the Options menu the end user interface can be configured and tested, tracing and logging can be performed, and reasoning can be initiated by finding expressions.  In addition the monitor can be enabled, single step mode can be selected and a default editor can be specified.

Trace All	Turns on tracing for all expressions in the loaded knowledge base.  An option is presented to either trace to the screen or trace to a file.  A trace uses a slightly different format to represent the same information that appears in the Inference Monitor's Events, Reasoning, and Conclusion displays.
Trace Expression	Turns on tracing only for the specified expression or expressions.  After the Trace Expression option is selected a prompt window appears asking for the label of the expression to be traced.
Untrace Expression	Turns tracing off for a specific expression set by Trace Expression.  After selecting this menu item the developer is prompted for the name of the expression for which tracing is to be discontinued.
Log	Writes the information that appears on the screen during a consultation to a file.  A dialog box appears that prompts for the name of the file into which to write.
Logging Off	Turns off logging that was started using Log.
Monitor	Makes the Inference Monitor screen accessible and changes the current focus to that screen.  When the Inference Monitor is toggled ON, the word Monitor in this menu will appear with a check mark to its left.
Single Step	When Monitor above is toggled ON, this option will be selectable.  If Single Step is selected, then Single Step mode in the Inference Monitor will be enabled.  This will permit M.4's reasoning to be displayed one inference at a time each time you click on the Step button in the Inference Monitor (see the section on the Inference Monitor screen for more details).
Find Expression	Asserts the indicated expression as the goal of a session with M.4.  Upon selection of this menu item an input box will appear allowing the developer to type the expression he wishes to declare as the goal of inferencing.
Configure End User I/F	Opens the End User Configuration Utility.  This utility provides the developer with the ability to configure the appearance of the Delivery End User screen.  When this menu item is selected the following dialog box will appear:

Figure:  The End User Configuration Utility Screen

The following features can be configured from the End User Configuration utility:

The Title  The title that appears in the window title bar can be changed by entering the new title in the Title input box.

Knowledge Base File  The name of the knowledge base file to load when the delivery system starts up is specified by entering the complete file name and pathname in the Knowledge Base File input box.  A file browser is available by clicking on the browse button to the right.

Cache File  The name of the cache file to load when the delivery system starts up is specified by entering the complete file name and pathname in the Cache File input box.  A file browser is available by clicking on the browse button to the right.

Open KS  Brings up a dialog box for finding and loading a knowledge system file.

Save KS  Brings up a dialog box for saving a knowledge system file.

Use Knowledge System now  Indicates whether, upon leaving the End User Configuration utility, the knowledge system you have configured should be used during your current session.

Why and Unknown buttons  If these boxes are checked then Why and Unknown will appear as buttons on the End User Delivery screen.  If they are not checked then they will be removed as a feature on the End User Delivery screen.

Menus  The File, Edit, Options, Browse, Window, and Help menus can be fully configured or removed by selecting one of the menus in the menu bar and selecting one or more of the toggles that appear in the menu.  Line separators that appear in the standard menu can also be selectively added or removed.  The default condition is for none of these menus to be selected.  If you want the menu bar to appear during End User Test, select a menu and a menu item from the selected menu (see figure below).

After all the desired selections have been made click on OK to accept the changes and create the newly configured Delivery End User screen.

Test End User I/F	Changes the interaction mode to End User Test mode.  In this mode the screen changes to the application delivery screen and only operations available during an end user consultation can be performed.  An End Test button is provided at the top of the current screen.  Clicking on this button will return the system to Development mode
Select Editor	Opens a dialog box in which the default editor program can be specified.  The indicated editor will be used whenever the Edit navigation button is selected.


Browse Menu

The Browse menu provides the ability to view KB and Cache information.  In addition information about system resource utilization and a listing of the expressions currently being traced can be displayed.

KB	Changes to the Browser screen and displays the currently loaded knowledge base in the Browser window.
KB by Label	Switches to the Browser screen and then prompts for a specific KB label (i.e., KB-1).  The KB entry that is indicated by the specified label is displayed in the Browser window,
KB by Expression	Switches to the Browser screen and then prompts for an expression.  All KB entries that contain the specified expression are displayed in the Browser window.
Cache	Changes to the Browser screen and displays the current cache in the Browser window.
Cache by Expression	Switches to the Browser screen and then prompts for an expression.  All Cache entries that contain the specified expression are displayed in the Browser window.
Core Info	Performs a core command and displays the results in the Browser window.  The core command gives information about available system resources.  The number of atoms and variable cells in use is given along with the number of bytes needed to store those atoms and variables.  Then the number of Cache and KB entries, rules, facts, and metafacts in the currently loaded knowledge base is displayed.  Lastly the quantity of stack memory available is displayed in bytes.  This command helps the developer to monitor system resources as the knowledge system is running.
Traced Expressions	Displays in the Browser window the expressions currently being traced.  For more information about tracing see the Trace All and Trace Expression selections on the Options menu.


Window Menu

The Window menu provides access to the various M.4 screens.  In addition the M.4 Command and Command Output display windows can be started from this menu.

User	Switches to the Developer End User screen.
Browser	Switches to the Browser screen.
Monitor	Switches to the Inference Monitor screen.
M.4 Command...	Opens up a window that accepts input of typed commands to the M.4 inference engine.  All commands supported by M.4 as specified in the M.4 User's Guide are available.  This window in concert with the M.4 Command Output display, supplies the same interface that is provided by M.4DOS as a development environment.  Output generated by commands given in the Command window is displayed in the Command Output window.
M.4 Command Output Display...	Opens up a window that displays information displayed as the result of commands entered in the M.4 Command window(see the preceding description of the M.4 Command window).


Help Menu

The Help menu provides access to information about the Graphical User Interface (GUI) and M.4.

About M.4 GUI	Brings up an About dialog box with information about the Graphical User Interface (GUI).


Dialog Boxes

M.4 VB employs six different types of dialog boxes for interaction with the developer.  During a session with M.4 VB the developer might see File Selection, Control, Input, Message, Edit, and About boxes. An additional dialog box that does not fit into any of these categories is the End User Configuration box.  This box is described in the Options menu, Configure End User I/F paragraph.

About Box	The About box displays information about the Graphical User Interface (GUI).  This box appears when the About M.4 GUI menu item on the Help menu is selected.  After the message is displayed the About box can be dismissed by clicking on the OK button.
Control Box	The Control box requires the developer to select among several buttons.  Different operations are performed depending on which button is clicked.  This box normally appears after a command with several options has been selected.  For example, if KB Entry is selected from the Edit menu and then the ADD option is selected, a Control box appears with the choices Beginning, End, and Cancel.  If Beginning is chosen, then the new KB entry is entered at the beginning of the knowledge base.  If End is chosen, then the new KB entry is entered at the end of the knowledge base.  After selection the new entry is placed at the indicated position in the knowledge base.
Edit Box	The Edit box appears when KB Entry is selected from the Edit menu.  A KB Entry label can be entered along with the text of the KB entry.  Clicking on Replace will replace the text of the KB entry with the specified label with the text in the Edit box.  Clicking on Add will bring up a control box with buttons for Beginning and End.  Clicking on the Beginning button will enter the text at the beginning of the knowledge base.  Clicking on the End button will enter the text at the end of the knowledge base.

Figure: The Edit Box

File Selection Box	The File Selection box appears whenever it is necessary for the developer to indicate the name and location of a file.  This box works exactly like the standard Windows 3.1 file selection box.  Default extensions are provided depending on the type of file needed to satisfy the current command.  For example, if File Open is selected a File Selection box appears with options for the type of file to open and where the information should be loaded.  The File Type Options are Knowledge System, Knowledge Base, and Cache.  The Method options available are Replace, Insert before KB, and Insert after KB.  If this is the first knowledge base to be loaded during a session, then Replace (the default) should be chosen.  Depending on the file type chosen either "*.KS", "*.KB" or "*.CSH" will appear in the input window near the top of the File Selection box.  After a drive and directory have been specified in the windows on the right the names of any files with the appropriate extension will appear in the window on the left.  A file name is selected by clicking on the desired knowledge base and then clicking on the OK button or by double clicking on the name of the desired knowledge base.
Input Box	The Input box appears whenever M.4 needs text to complete the operation it is currently performing.  After the text is entered either clicking on the "OK" button or hitting the carriage return will cause M.4 to accept the input.  Clicking on the "Cancel" button will end the current operation without performing any action.  For example, if the Trace Expression command is selected from the Options menu, an input box appears asking for the name of the expression to trace.
Message Box	The Message box appears whenever a system message is presented to the developer.  Message boxes are used to display warning, error, and informational messages.  After the developer has finished reading the information in the message box the box can be dismissed by clicking on the "OK" button.